package rolesystem.core;

import java.io.Serializable;

/**
 * This class represents an action done through a registration.
 * Instances of this class are constant, once created they cannot be changed.
 */
public class RoleAction implements Serializable
{
	/**
	 * Name of this action.
	 */
	private String name;

	/**
	 * Identifier of the addressee of this action.
	 */
	private int addressee;

	/**
	 * Informative content of this action (if any).
	 */
	private Serializable content;


	/**
	 * Constructor with no arguments, for serializability.
	 */
	private RoleAction()
	{
	}

	
	/**
	 * @param name Name of this action.
	 * @param addressee Identifier of the addresseer of this action.
	 * @param content Informative content of this action.
	 */
	public RoleAction(String name, int addressee,
		Serializable content)
	{
		this.name=name;
		this.addressee=addressee;
		this.content=content;
	}


	/**
	 * Constructs an action with no informative content.
	 * @param name Name of this action.
	 * @param addressee Identifier of the addresseer of this action.
	 */
	public RoleAction(String name, int addressee)
	{
		this.name=name;
		this.addressee=addressee;
		// content is left null;
	}


	/**
	 * Returns the name of this action.
	 * @return The name of this action.
	 */
	public String getName()
	{
		return name;
	}


	/**
	 * Returns the identifier of the addressee of this action.
	 * @return The identifier of the addressee of this action.
	 */
	public int getAddressee()
	{
		return addressee;
	}


	/**
	 * Returns the informative content of this action.
	 * @return The informative content of this action.
	 */
	public Serializable getContent()
	{
		return content;
	}
}
